import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/layout.vue'
import Login from '../views/login.vue'
import Table from '../views/01.表格.vue'
import Tree from '../views/03.tree.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: Index,
    redirect: '/table',
    children: [
      { path: '/table', name: 'table', component: Table },
      { path: '/tree', name: 'tree', component: Tree }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  }
]

const router = new VueRouter({
  // mode: 'history',
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
